<table cellpadding="0" cellspacing="0">
	<tr>
    	<th>ID</th>
        <th>Name</th>
        <th>Address</th>
        <th>Price Min => Max</th>
        <th>Category</th>
        <th>Provide</th>
        <th>Status</th>
        <th>Edit / Del</th>
    </tr>
    <?php if(count($data)>0){ foreach($data as $list){?>
		<tr>
            <th><?php echo $list["id"]; ?></th>
            <td><?php echo $list["name"]; ?></td>
            <td><?php echo $list["address"]; ?></td>
            <td><?php echo $list["pricemin"]." => ".$list["pricemax"]; ?> USD</td>
            <td><?php echo $list["category"]; ?></td>
            <td><?php echo $list["provide"]; ?></td>         
            <td><select name="changestatus" onChange="location.assign('<?php echo base_url(); ?>/admin/destination/changestatus?id=<?php echo $list["id"] ?>&status='+this.options[this.selectedIndex].value);"><option value="0" <?php if($list['status']==0) echo "selected";?>>Highlights</option><option value="1" <?php if($list['status']==1) echo "selected";?>>Normal</option><option value="2" <?php if($list['status']==2) echo "selected";?>>Hide</option></select></td>
            <th><a href="javascript:void(0);" onclick="location.assign('<?php echo base_url(); ?>admin/destination/index?id=<?php echo $list['id'] ?>');"><img src="<?php echo base_url(); ?>public/admin/img/icons/user_edit.png"/></a>
            <a href="javascript:void(0);" onClick="if(confirm('Do you want to Del this Information ?')) location.assign('<?php echo base_url(); ?>admin/destination/delete?id=<?php echo $list["id"]; ?>');"><img src="<?php echo base_url(); ?>public/admin/img/icons/user_delete.png"/></a></th>
    	</tr>
	<?php }}?>    
</table>

<div id="box">
	<form action="<?php echo base_url(); ?>admin/destination/<?php if(isset($_GET['id'])) echo "update?id=".$_GET["id"];else echo "insert";?>" method="post">
    	<fieldset id="personal">
            <legend>&nbsp;&nbsp;Edit Destination&nbsp;&nbsp;</legend>
            <label>ID : </label><?php if(count($detail)>0) echo $detail['id'];else echo "ID"; ?><br>
            <label>Name : </label><input name="name" required type="text" value="<?php echo $detail['name']; ?>" tabindex="2"><br>
            <label>Description : </label><textarea name="description"><?php echo $detail['description'] ?></textarea><br>
            <label>Avatar 1: </label><input name="fuavatar1" required type="file" tabindex="2"><img src="<?php echo $detail["avatar"];?>" width="150"/><br />	
            <label>Avatar 2: </label><input name="fuavatar2" required type="file" tabindex="2"><img src="<?php echo $detail["avatar2"];?>" width="150"/><br />            
			<label>Address : </label><input name="address" type="text" required value="<?php echo $detail['address'] ?>"/><br>
            <label>Promotion : </label><textarea name="promotion"><?php echo $detail['promotion']; ?></textarea><br />
            <label>Category : </label><input name="category" type="text" required value="<?php echo $detail['category'] ?>"/><br>
            <label>Detail : </label><br />
            <?php 
										$fck = new FCKeditor('detail');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['detail'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?><br />
            <label>Who use : </label><br />
            <?php 
										$fck = new FCKeditor('whoust');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['whoust'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?><br />
            <label>Overview : </label><br />
            <?php 
										$fck = new FCKeditor('overview');
										$fck->BasePath = sBASEPATH;
								        $fck->Value  = $detail['overview'];					
										$fck->Width  = '100%';
										$fck->Height = 400;
										$fck->Create();
									   ?><br />
            <label>Price Min : </label><input name="pricemin" required type="text" value="<?php echo $detail['pricemin']; ?>" tabindex="2"><br>
            <label>Price Max : </label><input name="pricemax" required type="text" value="<?php echo $detail['pricemax']; ?>" tabindex="2"><br>            
            <label>P.o Image : </label><input name="pathofimage" type="text" required value="<?php echo $detail['pathofimage'] ?>"/><br>
            <label>Provide : </label><input name="provide" type="text" required value="<?php echo $detail['provide'] ?>"/><br>
            <label>Status : </label><select name="status"><option value="-1">Choice Status</option><option value="0" <?php if($detail['status']==0) echo "selected"; ?>>Highlights</option><option value="1" <?php if($detail['status']==1) echo "selected"; ?>>Normal</option><option value="2" <?php if($detail['status']==2) echo "selected"; ?>>Hide</option></select><br />
            <div style="float:left;padding-top:5px;padding-left:40%;"><input type="reset" value="Reset">&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Submit"></div>
          </fieldset>
    </form>
</div>